package edu.zqu.instructionalMatters.project.mapper;

import edu.zqu.instructionalMatters.project.entity.Calendar;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Author 何文东
 * @Date 2020-07-03
 * @Description: 校历 - Mapper 接口
 * @Version 1.0
 */
public interface CalendarMapper extends BaseMapper<Calendar> {
    @Select("<script>" + "select * from calendar where college_id = #{collegeId} " +
            " <if test = 'semesterId != null'>" +
            " and semester_id = #{semesterId}" +
            " </if>" +
            "<if test = 'theDate != null'>" +
            " and the_date = #{theDate}" +
            " </if>" +
            "<if test = 'holiday != null'>" +
            " and holiday = #{holiday}" +
            " </if> " + "</script>")
    public List<Calendar> findAll(Calendar calendar);
}
